package com.yswy.domain.vo.gld.addOrUpate;

import com.yswy.common.annotation.DateFormat;
import com.yswy.domain.vo.gld.addOrUpate.base.BaseReqVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * @author 19401
 * @date 2022/6/6 17:09
 **/
@Data
@ApiModel(value = "DomainCertificateAddOrUpdate", description = "添加或更新领域证书请求对象")
public class DomainCertificateAddOrUpdate extends BaseReqVO {
    @NotNull(message = "ID不能为空", groups = {UPDATE.class , DElECT.class})
    private Long id;

    @ApiModelProperty("域名Id")
    @NotNull(message = "域名Id不能为空", groups = {CREATE.class})
    private Long domainId;

    @ApiModelProperty("域名")
    @NotEmpty(message = "域名不能为空", groups = {CREATE.class})
    private String domainName;

    @ApiModelProperty("使用范围")
    private String usdRange;

    @ApiModelProperty("证书文件路径")
    private String certificateUrl;

    @ApiModelProperty(value = "证书文件 文件",required = true)
    @NotNull(message = "证书文件不能为空", groups = {CREATE.class})
    private MultipartFile certificateFile;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("证书到期时间")
    @NotNull(message = "证书到期时间不能为空", groups = {CREATE.class})
    private Date expirationTime;
}
